package com.gao.args;

/**
 * @Author: ShanYuqing
 * @Version: v1.0
 */
public class ArgsDemo {
    public static void main(String[] args) {
        System.out.println(getSum(1, 2, 3, 4));
    }

    public static int getSum(int... nums) {
        int sum = 0;
        for (int num : nums) {
            sum += num;
        }
        return sum;
    }
}
